<?php
$params = array_merge( require __DIR__ . '/../../common/config/params.php' , require __DIR__ . '/../../common/config/params-local.php' , require __DIR__ . '/params.php' , require __DIR__ . '/params-local.php' );

return [
    'id'                  => 'app-api' ,
    'basePath'            => dirname( __DIR__ ) ,
    'timeZone'            => 'Asia/Shanghai' ,
    'controllerNamespace' => 'api\common\controllers' ,
    'defaultRoute'        => 'site/index' ,
    'bootstrap'           => [ 'log' ] ,
    'modules'             => [
        'v1' => [
            'class' => 'api\modules\v1\Module' ,
        ] ,
    ] ,
    'layout'              => FALSE ,
    'components'          => [
        'request'      => [
            'csrfParam' => '_csrf-api' ,
        ] ,
        'user'         => [
            'identityClass'   => 'api\common\models\AdminUser' ,
            'enableAutoLogin' => FALSE ,
            'enableSession'   => FALSE ,
            'loginUrl'        => NULL ,
        ] ,
        'log'          => [
            'traceLevel' => YII_DEBUG ? 3 : 0 ,
            'targets'    => [
                [
                    'class'  => 'yii\log\FileTarget' ,
                    'levels' => [ 'error' , 'warning' ] ,
                ] ,
            ] ,
        ] ,
        'errorHandler' => [
            'errorAction' => 'site/error' ,
        ] ,
        'urlManager'   => [
            'enablePrettyUrl'     => TRUE ,         // 启用美化URL
            'enableStrictParsing' => FALSE ,        // 是否执行严格的url解析
            'showScriptName'      => FALSE ,        // 在URL路径中是否显示脚本入口文件
            'rules'               => [] ,
        ] ,
    ] ,
    'params'              => $params ,
];
